<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var wi = $("#info").width();
		var hi = $("#info").height();
		window.resizeTo(350, 500);
		
		$("#updateInfo").click(function(){
			if($("input[name=nick]").val()=="")
			{
				alert("닉네임을 입력하세요");
				return false;
			}
			if($("input[name=name]").val()=="")
			{
				alert("이름을 입력하세요");
				return false;
			}
			else if($("input[name=address]").val()=="")
			{
				alert("주소를 입력하세요");
				return false;
			}
			else if($("input[name=password]").val()!=$("input[name=checkPassword]").val())
			{
				alert("패스워드가 일치하지 않습니다.");
				$("input[name=password]").val("");
				$("input[name=checkPassword]").val("");
				return false;
			}
			if($("input[name=password]").val()=="")
			{
				$("input[name=password]").val("${sessionScope.vo.password}");
			}
			$("#updateForm").attr("action", "updateInfo.do").submit();
		})
		$("#close").click(function(){
			location.href="member_userInfo.do";
		})
	})
</script>
<style type="text/css">
.updatebtn{
	font-size:12px;
	font-family:Arial;
	font-weight:bold;
	-moz-border-radius:7px;
	-webkit-border-radius:7px;
	border-radius:7px;
	border:1px solid #dcdcdc;
	padding:5px 10px;
	text-decoration:none;
	background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #ffffff), color-stop(100%, #e9e9e9) );
	background:-moz-linear-gradient( center top, #ffffff 5%, #e9e9e9 100% );
	background:-ms-linear-gradient( top, #ffffff 5%, #e9e9e9 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e9e9e9');
	background-color:#ffffff;
	color:#666666;
	display:inline-block;
	text-shadow:0px 0px 0px #ffffff;
 	-webkit-box-shadow:inset 1px 1px 0px 0px #ffffff;
 	-moz-box-shadow:inset 1px 1px 0px 0px #ffffff;
 	box-shadow:inset 1px 1px 0px 0px #ffffff;
}
.updatebtn:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #e9e9e9), color-stop(100%, #ffffff) );
	background:-moz-linear-gradient( center top, #e9e9e9 5%, #ffffff 100% );
	background:-ms-linear-gradient( top, #e9e9e9 5%, #ffffff 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#ffffff');
	background-color:#e9e9e9;
}
.updatebtn:active {
	position:relative;
	top:1px;
}

.CSSTableGenerator_info {
	margin:0px;
	padding:0px;
	width:100%;
	border:1px solid #000000;
	
	-moz-border-radius-bottomleft:10px;
	-webkit-border-bottom-left-radius:10px;
	border-bottom-left-radius:10px;
	
	-moz-border-radius-bottomright:10px;
	-webkit-border-bottom-right-radius:10px;
	border-bottom-right-radius:10px;
	
	-moz-border-radius-topright:10px;
	-webkit-border-top-right-radius:10px;
	border-top-right-radius:10px;
	
	-moz-border-radius-topleft:10px;
	-webkit-border-top-left-radius:10px;
	border-top-left-radius:10px;
}
.CSSTableGenerator_info table{
    border-collapse: collapse;
        border-spacing: 0;
	/* width:100%;
	height:100%; */
	margin:0px;padding:0px;
}
.CSSTableGenerator_info tr:last-child td:last-child {
	-moz-border-radius-bottomright:10px;
	-webkit-border-bottom-right-radius:10px;
	border-bottom-right-radius:10px;
}
.CSSTableGenerator_info table tr:first-child td:first-child {
	-moz-border-radius-topleft:10px;
	-webkit-border-top-left-radius:10px;
	border-top-left-radius:10px;
}
.CSSTableGenerator_info table tr:first-child td:last-child {
	-moz-border-radius-topright:10px;
	-webkit-border-top-right-radius:10px;
	border-top-right-radius:10px;
}
.CSSTableGenerator_info tr:last-child td:first-child{
	-moz-border-radius-bottomleft:10px;
	-webkit-border-bottom-left-radius:10px;
	border-bottom-left-radius:10px;
}
.CSSTableGenerator_info tr:hover td{
	background-color:#ffffff;
}
.CSSTableGenerator_info td{
	vertical-align:middle;
	background:-o-linear-gradient(bottom, #ffffff 5%, #ffffff 100%);	
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #ffffff) ); 
	background:-moz-linear-gradient( center top, #ffffff 5%, #ffffff 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffffff", endColorstr="#ffffff");	
	background: -o-linear-gradient(top,#ffffff,ffffff);
	background-color:#ffffff;
	border:1px solid #000000;
	border-width:0px 1px 1px 0px;
	text-align:center;
	padding:7px;
	font-size:12px;
	font-family:Arial;
	font-weight:bold;
	color:#000000;
}.CSSTableGenerator_info tr:last-child td{
	border-width:0px 1px 0px 0px;
}.CSSTableGenerator_info tr td:last-child{
	border-width:0px 0px 1px 0px;
}.CSSTableGenerator_info tr:last-child td:last-child{
	border-width:0px 0px 0px 0px;
}
.CSSTableGenerator_info tr:first-child td:first-child{
	border-width:0px 0px 1px 0px;
}
.CSSTableGenerator_info tr:first-child td:last-child{
	border-width:0px 0px 1px 1px;
}
</style>
</head>
<body>
<h2 align="center">회원 정보 수정</h2>
<form method="post" id="updateForm">
<table class="CSSTableGenerator_info" id="info">
	<tr>
		<td>아이디</td><td><input type="text" name="id" value="${sessionScope.vo.id}" readonly></td>
	</tr>
	<tr>
		<td>패스워드 변경</td><td><input type="password" name="password"></td>
	</tr>
	<tr>
		<td>패스워드 확인</td><td><input type="password" name="checkPassword"></td>
	</tr>
	<tr>
		<td>닉네임</td><td><input type="text" name="nick" value="${sessionScope.vo.nick}"></td>
	</tr>
	<tr>
		<td>이름</td><td><input type="text" name="name" value="${sessionScope.vo.name}"></td>
	</tr>
	<tr>
		<td>주소</td><td><input type="text" name="address" value="${sessionScope.vo.address}"></td>
	</tr>
	<tr>
		<td>등급</td><td>${sessionScope.vo.grade}</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="button" id="updateInfo" value="수정" class="updatebtn">
			<input type="button" id="close" value="취소" class="updatebtn">
		</td>
	</tr>
</table>
</form>
</body>
</html>